package com.PTA;

import java.util.Scanner;

public class P1007 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int count = 0;
        if (n<3){
            System.out.println(0);
            return;
        }
        for (int i=3;i<=n-2;i+=2){
            if (is(i) && is(i+2))
                count++;
        }
        System.out.println(count);
    }

    public static boolean is(int n){
        if (n<2) return false;
        for (int i=2;i<=(int)Math.sqrt(n);i++){
            if (n%i==0) return false;
        }
        return true;
    }
}
